/**
 * @param {string} command
 * @return {string}
*/
var interpret = function(command) {
  const oReg = /\(\)/g;
  const contentReg = /\((.*?)\)/g;
  command = command.replace(oReg, function() {
    return 'o';
  });
  command = command.replace(contentReg, function(...payload) {
    return payload[1];
  });
  return command;
};
let command = "G()(al)";
console.log(interpret(command));
command = "G()()()()(al)";
console.log(interpret(command));
command = "(al)G(al)()()G";
console.log(interpret(command));
